package org.graduation.recruitment.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.graduation.recruitment.entity.dto.UserLoginDTO;
import org.graduation.recruitment.entity.pojo.StudentUser;

/**
 * 学生用户Mapper接口，继承自BaseMapper，用于操作学生用户表
 */
@Mapper
public interface StudentUserMapper extends BaseMapper<StudentUser> {

    /**
     * 根据账号和密码查询学生用户信息
     *
     * @param dto 包含账号（student_id）和密码（password）的登录信息数据传输对象
     * @return 登录成功返回匹配的学生用户对象，否则返回null
     */
    @Select("SELECT * FROM student_user where student_id = #{account} and password = #{password}")
    StudentUser login(UserLoginDTO dto);
}
